home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 52
/
Mac Magazin and MacEasy Magazine CD - Issue 52.iso
/
Updates
/
Stata 5.0 Ado-files
/
ado.sea
/
newado
/
sdtest.ado
< prev
next >
Wrap
Text File
|
1998-11-22
|
1KB
|
48 lines
*! version 3.0.0 23oct1997
program define sdtest
version 5.0
local varlist "req ex max(1)"
local exp "opt noprefix"
local if "opt"
local in "opt"
local options "BY(string) Level(integer $S_level)"
parse "`*'"
tempvar touse
mark `touse' `if' `in'
if "`exp'"!="" {
if "`by'"!="" {
di in red "may not combine = and by()"
exit 198
}
capture confirm number `exp'
if _rc == 0 { /* Do chi-squared test. */
_ttest one sdtesti `level' `touse' `varlist' `exp'
exit
}
/* If here, do variance ratio test with 2 variables. */
_ttest two sdtesti `level' `touse' `varlist' `exp'
exit
}
/* If here, do variance ratio test with by() variable. */
if "`by'"=="" {
di in red "by() option required"
exit 100
}
confirm variable `by'
local nbyvars : word count `by'
if `nbyvars' > 1 {
di in red "only variable allowed in by()"
exit 103
}
_ttest by sdtesti `level' `touse' `varlist' `by'
end